using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Zero.Entity.Models.Mapping
{
    public class CF_UserMap : EntityTypeConfiguration<CF_User>
    {
        public CF_UserMap()
        {
            // Primary Key
            this.HasKey(t => t.UserID);

            // Properties
            this.Property(t => t.UserID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.LoginName)
                .HasMaxLength(50);

            this.Property(t => t.LoginPassword)
                .HasMaxLength(50);

            this.Property(t => t.DeptID)
                .HasMaxLength(50);

            this.Property(t => t.SupplierID)
                .HasMaxLength(50);

            this.Property(t => t.EmployeeID)
                .HasMaxLength(50);

            this.Property(t => t.RealName)
                .HasMaxLength(50);

            this.Property(t => t.Title)
                .HasMaxLength(50);

            this.Property(t => t.Phone)
                .HasMaxLength(50);

            this.Property(t => t.Fax)
                .HasMaxLength(50);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.QQ)
                .HasMaxLength(50);

            this.Property(t => t.NickName)
                .HasMaxLength(50);

            this.Property(t => t.Address)
                .HasMaxLength(200);

            this.Property(t => t.CreateUserID)
                .HasMaxLength(50);

            this.Property(t => t.ModifyUserID)
                .HasMaxLength(50);

            this.Property(t => t.SID)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("CF_User");
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.LoginName).HasColumnName("LoginName");
            this.Property(t => t.LoginPassword).HasColumnName("LoginPassword");
            this.Property(t => t.DeptID).HasColumnName("DeptID");
            this.Property(t => t.SupplierID).HasColumnName("SupplierID");
            this.Property(t => t.EmployeeID).HasColumnName("EmployeeID");
            this.Property(t => t.RealName).HasColumnName("RealName");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Sex).HasColumnName("Sex");
            this.Property(t => t.Phone).HasColumnName("Phone");
            this.Property(t => t.Fax).HasColumnName("Fax");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.QQ).HasColumnName("QQ");
            this.Property(t => t.NickName).HasColumnName("NickName");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.LastLoginTime).HasColumnName("LastLoginTime");
            this.Property(t => t.CreateUserID).HasColumnName("CreateUserID");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.ModifyUserID).HasColumnName("ModifyUserID");
            this.Property(t => t.ModifyDate).HasColumnName("ModifyDate");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
            this.Property(t => t.OrderIndex).HasColumnName("OrderIndex");
            
        }
    }
}
